package com.uhealin;

import java.io.IOException;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

public class HotelMapper extends Mapper<LongWritable,Text,Hotel,NullWritable>{

	@Override
	protected void map(LongWritable key, Text value, Mapper<LongWritable, Text, Hotel, NullWritable>.Context context)
			throws IOException, InterruptedException {
		// TODO 자동 생성된 메소드 스텁
		Hotel hotel=new Hotel();
		hotel.setHotal(value);
		context.write(hotel, NullWritable.get());
		if(hotel.getType().get()==0){
		
			hotel.setXYa(1, 0);
			context.write(hotel, NullWritable.get());
			hotel.setXYa(1, 1);
			context.write(hotel, NullWritable.get());
			hotel.setXYa(1, -1);
			context.write(hotel, NullWritable.get());
			hotel.setXYa(-1, 0);
			context.write(hotel, NullWritable.get());
			hotel.setXYa(-1, 1);
			context.write(hotel, NullWritable.get());
			hotel.setXYa(-1, -1);
			context.write(hotel, NullWritable.get());
			hotel.setXYa(0, 1);
			context.write(hotel, NullWritable.get());
			hotel.setXYa(0, -1);
			context.write(hotel, NullWritable.get());
			
			
		}
	}

}
